package org.example.classtopia.Mapper;

import org.example.classtopia.Model.Entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 分类Mapper接口
 */
@Mapper
public interface CategoryMapper {

    int insertCategory(Category category);

    Category selectCategoryById(@Param("id") Long id);

    List<Category> selectAllCategories(@Param("offset") int offset, @Param("limit") int limit);

    int updateCategory(Category category);

    int deleteCategoryById(@Param("id") Long id);

    // 根据状态获取分类列表（可选）
    List<Category> selectCategoriesByStatus(@Param("status") Byte status, @Param("offset") int offset, @Param("limit") int limit);
}
